﻿#region (C) Header Region @ 2013
//====================================================
// 文件: ResourceUrlCache.cs
// 描述: 
// 路径: Antu.Core\Master\ResourceUrlCache.cs
// ******************版本1 ******************
// 人员: 蔡金保    时间 : 2013/1/8 11:38:02
// 注释: 
//====================================================
#endregion


using System;
using System.Collections.Generic;
using System.Text;

namespace Antu.Core.Master
{
    public class ResourceUrlCache
    {
        private Dictionary<string, string> dict = new Dictionary<string, string>();

        private static readonly ResourceUrlCache _ResourceUrlCache = new ResourceUrlCache();

        public static ResourceUrlCache Current
        {
            get
            {
                return _ResourceUrlCache;
            }
        }

        public void AddScript(string key, string script)
        {
            if (dict.ContainsKey(key))
            {
                dict[key] = script;
            }
            else
            {
                dict.Add(key, script);
            }
        }

        public string GetScript(string key)
        {
            if (dict.ContainsKey(key))
            {
                return dict[key];
            }
            return string.Empty;
        }

        public bool Exists(string key)
        {
            return dict.ContainsKey(key);
        }
    }
}
